home *** CD-ROM | disk | FTP | other *** search
- Path: news.mira.net.au!news
- From: davidw@werple.net.au (David White)
- Newsgroups: comp.lang.c++
- Subject: Re: Why use a reference on a ptr foo(int &*parm) as a formal parm ?
- Date: 12 Feb 1996 20:31:27 +1100
- Organization: Werple Internet, Melbourne
- Message-ID: <4fn1df$n7u@werple.net.au>
- References: <311DC7A8.2A1C@worldcom.ch>
- NNTP-Posting-Host: werple.mira.net.au
-
- Jean-Pierre Schnyder <jschnyde@worldcom.ch> writes:
-
- >Hi,
-
- >I'm not sure to understand the rationale for this technique. Any idea ?
-
- >I'd appreciate if you emailed me the answer !
-
- There is no rationale for it because a pointer to a reference is illegal.
- I suppose you meant 'int *&parm', in which case it is used so the
- function can change the value of the referenced pointer. It is just a
- cleaner syntax than the alternative, a pointer to a pointer, although it
- is not obvious where the call is made that the function is able to change
- the value of the passed pointer.
-
- David White
- davidw@werple.mira.net.au
-
-